//
//  HOMObjectWrapper.h
//  HigherOrderMessaging
//
//  Created by Ofri Wolfus on 18/10/05.
//  Copyright 2005 Ofri Wolfus. All rights reserved.
//

#import <Foundation/NSProxy.h>

/*!
 * @header HOMObjCValue
 * HOMObjectWrapper simply forwards one message to its target.
 * @copyright Created by Ofri Wolfus on 18/10/05. Copyright 2004-2005 Ofri Wolfus. All rights reserved.
 * @updated 2005-10-18
 * @version 0.1
 */


/*!
 * @class HOMObjectWrapper
 * @abstract HOMObjectWrapper forwards any message it can't respond to, to its target.
 * @discussion HOMObjectWrapper instances are recycled by default. If you don't want them to be recycled, call
 * <code>[HOMObjectWrapper setRecyclingEnabled:NO forClass:HOMObjectWrapper]</code>.
 */
@interface HOMObjectWrapper : NSProxy {
	id		target;
	BOOL	oneShot;
}

/*!
 * @method wrapperWithTarget:oneShot:
 * @abstract Returns a new initialized autoreleased HOMObjectWrapper instance and sets its target.
 * @param value If value is <code>YES</code>, the receiver will release itself after one message has been forwarded.
 * @result An initialized HOMObjectWrapper instance.
 */
+ (id)wrapperWithTarget:(id <NSObject>)aTarget oneShot:(BOOL)value;

/*!
 * @method initWithTarget:oneShot:
 * @abstract Returns a new initialized HOMObjectWrapper instance and sets its target.
 * @param value If value is <code>YES</code>, the receiver will release itself after one message has been forwarded.
 * @result An initialized HOMObjectWrapper instance.
 */
- (id)initWithTarget:(id <NSObject>)aTarget oneShot:(BOOL)value;

/*!
 * @method target
 * @abstract Returns the target of the receiver.
 */
- (id <NSObject>)target;

/*!
 * @method isObjectWrapper
 * @abstract Indicates that the receiver is an object wrapper.
 */
- (BOOL)isObjectWrapper;

@end
